﻿using Camc.Quality.RecordTable.FormBase;
using Camc.Quality.RecordTable.FormClass;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Camc.Quality.RecordTable.FormEntity
{
    public class 传感器安装测试记录情况统计记录表 : TableBase
    {
        public 传感器安装测试记录情况统计记录表(int serialNum, Guid workStepEntityId, Guid processesEntityId, int sort, string parentProductNum, string parentProductName, string fisrtDrawingNum, string firstDrawingName, string recordElement, string recordItem, string toolUsed,string secondToolUsed,string thirdToolUsed)
        {
            SerialNum = serialNum;
            WorkStepEntityId = workStepEntityId;
            ProcessesEntityId = processesEntityId;
            Sort = sort;

            ParentProductNum = parentProductNum;
            ParentProductName = parentProductName;
            FisrtDrawingNum = fisrtDrawingNum;
            FirstDrawingName = firstDrawingName;
            RecordElement = recordElement;
            RecordItem = recordItem;
            ToolUsed = toolUsed;
            SecondToolUsed = secondToolUsed;
            ThirdToolUsed = thirdToolUsed;

        }
        public override string FormName { get; protected set; } = "传感器安装测试记录情况统计记录表";

        public override string ParentProductNum_DisplayName { get; protected set; } = "图号";
        public override bool ParentProductNum_Show { get; protected set; } = true;
        public override int ParentProductNum_Property { get; protected set; } = 2;

        public override string ParentProductName_DisplayName { get; protected set; } = "名称";
        public override bool ParentProductName_Show { get; protected set; } = true;
        public override int ParentProductName_Property { get; protected set; } = 2;

        public override string FisrtDrawingNum_DisplayName { get; protected set; } = "传感器代号";
        public override bool FisrtDrawingNum_Show { get; protected set; } = true;

        public override string FirstDrawingName_DisplayName { get; protected set; } = "传感器名称";
        public override bool FirstDrawingName_Show { get; protected set; } = true;

        public override string RecordElement_DisplayName { get; protected set; } = "导通检查点";
        public override bool RecordElement_Show { get; protected set; } = true;

        public override string RecordItem_DisplayName { get; protected set; } = "绝缘检查点";
        public override bool RecordItem_Show { get; protected set; } = true;

        public override string ToolUsed_DisplayName { get; protected set; } = "所用数字三用表编号";
        public override bool ToolUsed_Show { get; protected set; } = true;
        public override bool ToolUsed_Enable { get; protected set; } = true;

        public override string SecondToolUsed_DisplayName { get; protected set; } = "所用指针三用表编号";
        public override bool SecondToolUsed_Show { get; protected set; } = true;
        public override bool SecondToolUsed_Enable { get; protected set; } = true;
      //  public override int SecondToolUsed_Property { get; protected set; } = 1;


        public override string ThirdToolUsed_DisplayName { get; protected set; } = "所用温湿度计编号";
        public override bool ThirdToolUsed_Show { get; protected set; } = true;
        public override bool ThirdToolUsed_Enable { get; protected set; } = true;
     //   public override int ThirdToolUsed_Property { get; protected set; } = 1;

        public RecordRequirementsEntity SetRecordRequirements(RecordRequirementsEntity entity,string recordLocation, string rcordStatus, string recordRequire, string recordMainopoint, string designerDemand, string processorDemand)
        {
            entity.SetRecordLocation(recordLocation, "参数代号", false, true, 0);
            entity.SetRecordStatus(rcordStatus, "状态", false, true, 2);
            entity.SetRecordRequire(recordRequire, "测试仪器1", false, true, 0);
            entity.SetRecordMainopoint(recordMainopoint, "测试仪器2", false, true, 0);
            entity.SetDesignerDemand(designerDemand, "导通要求阻值", false, true, 0);
            entity.SetProcessorDemand(processorDemand, "绝缘要求阻值", false, true, 0);
            return entity;
        }
        public MeasuredResultEntity SetMeasuredResult(MeasuredResultEntity entity,string firstMeasuredValues,string secondMeasuredValues)
        {
            entity.SetFirstMeasuredValues(firstMeasuredValues, "实测阻值1", true, true, 0);
            entity.SetSecondMeasuredValues(secondMeasuredValues, "实测阻值2", true, true, 0);
            return entity;
        }
        /// <summary>
        /// 插入环境要素
        /// </summary>
        public EnvironmentEntity SetEnvironment(EnvironmentEntity entity,string temperature, string humidity)
        {
            entity.SetTemperature(temperature, "温度", true, true, 2);
            entity.SetHumidity(humidity, "湿度", true, true, 2);
            return entity;
        }
        /// <summary>
        /// 三检
        /// </summary>
        public InspectionSignatureEntity SetInspectionSignature(InspectionSignatureEntity entity)
        {
            entity.InspectionSignatureName = "三检";
            entity.SetFirstOperator(null, "操作者", true, true, 0, null, "操作者操作时间", true, true, 0);
            entity.SetSecondOperator(null, "互检者", true, true, 0, null, "互检者操作时间", true, true, 0);
            entity.SetThirdOperator(null, "检验员", true, true, 0, null, "检验员操作时间", true, true, 0);
            return entity;
        }
    }
}
